package com.neuedu.ylbx.controller;

import com.neuedu.ylbx.pojo.InpatientDiagnosis;
import com.neuedu.ylbx.service.MedicalServiceService;
import com.neuedu.ylbx.service.PatientOrderService;
import com.neuedu.ylbx.utils.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/hospital")
@CrossOrigin
@Api(tags = "患者医嘱管理")
public class PatientOrderController {
    @Autowired
    private PatientOrderService patientOrderService;

    @ApiOperation("获取患者医嘱列表")
    @GetMapping("/orders/patient/{patientId}")
    public ResultVo<List<InpatientDiagnosis>> getpatientOrderList() throws Exception{
        return ResultVo.ok(patientOrderService.list());
    }

    @ApiOperation("取消医嘱")
    @GetMapping("/orders/{orderId}/cancel")
    public ResultVo cancelpatientOrder(Integer id)throws Exception{
        patientOrderService.removeById(id);
        return ResultVo.ok("删除成功");
    }
}
